$(function(){
	document.oncontextmenu 	= function(){return false;};

	window.app = new Rainier.UI.V2.Application($("#application"),"直流电路仿真实验项目");

	window.app.platformInfo = {
		company  : "北京润尼尔网络科技有限公司",
		version  : "v3.0.0",
	};
	
	var menuComponent = new Rainier.UI.V2.AppMenuComponent(app);
	var controlComponent = new Rainier.UI.V2.AppControlComponent(app);
	// var exprimentComponent = new Rainier.UI.V2.AppExprimentComponent(app);
	var searchComponent = new Rainier.UI.V2.AppSearchComponent(app);
	var partLibComponent = new Rainier.UI.V2.AppPartLibComponent(app);
	var propertyComponent= new Rainier.UI.V2.AppPropertyComponent(app);

	app.registerViewComponent({APP_VIEW_COMPONENT_MENU:menuComponent});
	app.registerViewComponent({APP_VIEW_COMPONENT_CONTROL:controlComponent});
	app.registerViewComponent({APP_VIEW_COMPONENT_PARTLIB:partLibComponent});
	app.registerViewComponent({APP_VIEW_COMPONENT_PROPERTY:propertyComponent});
	app.registerViewComponent({APP_VIEW_COMPONENT_PARTLIB:partLibComponent});
	app.registerViewComponent({APP_VIEW_COMPONENT_SEARCH:searchComponent});
	app.buildGUI();
	
	//全屏之后执行ESC事件
    window.onresize = function(){
        var $fullScreen = $("#full_screen");
        if(!checkFull()){
           $fullScreen.children("a").addClass("fullScreenImg");
           $fullScreen.children("a").removeClass("leaveFullScreenImg");
           $fullScreen.attr("title","全屏");
        }
    }
    function checkFull(){
        var isFull =  document.fullscreenEnabled || window.fullScreen || document.webkitIsFullScreen || document.msFullscreenEnabled;
        
        //to fix : false || undefined == undefined
        if(isFull === undefined) isFull = false;
        return isFull;
    }
});